package org.bigdata.leo.hbase.sample.controller;

import org.bigdata.leo.hbase.starter.sdk.HBaseTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author leo.jie (weixiao.me@aliyun.com)
 * @version 1.0
 * @organization bigdata
 * @website https://www.jielongping.com
 * @date 2020/3/30 10:18 下午
 * @since 1.0
 */
@RestController
public class HBaseController {
    private final HBaseTemplate hBaseTemplate;

    public HBaseController(HBaseTemplate hBaseTemplate) {
        this.hBaseTemplate = hBaseTemplate;
    }

    @GetMapping("/test")
    public List<String> getTables(){
        return hBaseTemplate.getTableNames();
    }
}
